<?php
if(!ROOT){
	exit('Access denied');
}
#数据库创建表
$query=array();
$query[]="CREATE TABLE IF NOT EXISTS `".DB_PREFIX."link` (
  `link_id` tinyint(3) unsigned NOT NULL auto_increment,
  `link_name` varchar(50) NOT NULL,
  `link_text` varchar(255) NOT NULL,
  `link_url` varchar(255) NOT NULL,
  `link_sort` int(4) unsigned NOT NULL default '0',
  `link_status` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`link_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";

#执行命令
if(count($query)>0){
	foreach($query as $sql){
		$this->db->query($sql);
	}
}
$template_admin=array(
	'link.info',
	'link.list'
);
foreach($template_admin as $v){
	@copy(ROOT."/core/modules/link/copy/template.admin/".$v.".php",ROOT."/core/themes/admin/".$v.".php");
}
$template_admin=array(
	'link.info',
	'link.list'
);
foreach($template_admin as $v){
	@copy(ROOT."/core/modules/link/copy/template.admin/".$v.".php",ROOT."/core/themes/admin/".$v.".php");
}